package com.gao.entity;

import com.gao.dto.AnswerDto;
import com.mybatisflex.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Table("consultation")
public class Consultation implements Serializable {
  @Id(keyType = KeyType.Auto)
  private Integer id;
  private String title;
  private String keywords;
  private String content;
  private Integer userId;
  @RelationManyToOne(selfField = "userId", targetField = "id")
  private User user;
  private String status;
  @Column(onInsertValue = "now()")
  private LocalDateTime createTime;
  @Column(onUpdateValue = "now()")
  private LocalDateTime updateTime;
  @RelationOneToMany(targetField = "consultationId")
  private List<Answer> answers;
}
